import request from '@/utils/request'

//从配置中获取业务的地址
import { baseUrlConfig } from '@/config/config'
const basePath = baseUrlConfig.businessBaseUrl

//获取分页列表
export const seatPageList: (data: any) => Promise<[]> = (data) => {
    return request({
        url: basePath + '/pax/tcdmeqpt/find/page',
        method: 'post',
        data
    })
}

//删除
export const seatDeleteRow: (data: any) => Promise<[]> = (data: any) => {
    console.log(data, 111)
    return request({
        url: basePath + `/pax/tcdmeqpt/delete?eqptId=${data}`,
        method: 'get',
    })
}


//下载模板
export const seatModuleDown = () => {
    return request({
        url: basePath + "/pax/tcdmeqpt/down",
        responseType: 'blob',
        method: 'get',
    })
}

//导入
export const seatImport = (data: FormData) => {
    return request({
        url: basePath + '/pax/tcdmeqpt/import',
        headers: {
            'Content-Type': 'multipart/form-data'
        },
        method: 'post',
        data
    })
}

//导出当前页的数据
export const exportPageList: (data: any) => Promise<[]> = (data: any) => {
    return request({
        url: basePath + '/pax/tcdmeqpt/export',
        method: 'post',
        responseType: 'blob',
        data
    })
}

// 增加
// @ts-ignore
export const append = (data) => {
    return request({
        url: basePath + '/pax/tcdmeqpt/append',
        method: 'post',
        data
    })
}

// 编辑
// @ts-ignore
export const change = (data) => {
    return request({
        url: basePath + '/pax/tcdmeqpt/change',
        method: 'post',
        data
    })
}
// 获取设备类型
export const geteqptType = (data: any) => {
    return request({
        url: basePath + '/eqpt/type/find',
        method: 'post',
        data
    })
}